package com.OnTimeTeam.OnTime;

import android.app.ProgressDialog;
import android.os.AsyncTask;

public class RoutDetailsAsistance extends AsyncTask<String, Void, RegularRoadsQuery> {

    ProgressDialog progressDialog;
    
	private RouteDetailsTabHost host;
	
	public RoutDetailsAsistance(RouteDetailsTabHost host){
		this.host = host;
	}
	
    protected RegularRoadsQuery doInBackground(String... params) {//In Background
    	
		RegularRoadsQuery roadsQ = new RegularRoadsQuery(params[0], params[1], true, params[2]);
   		roadsQ.setParameters();
    	return roadsQ;
    }      

    protected void onPreExecute() {//Before
    	super.onPreExecute();

    	progressDialog = ProgressDialog.show(host, host.getResources().getString(R.string.uploadAlertDetails), host.getResources().getString(R.string.pleaseWait));
    }
    
    protected void onPostExecute(RegularRoadsQuery result) {//After
    	progressDialog.dismiss();
    	host.roadsQ = result;
    	host.alRoute = result.getCoordinates();
    	host.createTabs();
    	
    }



    protected void onProgressUpdate(Void... values) {
    	
    	
    }
}